This is a Flask-based application for managing a database of CVEs (Common Vulnerabilities and Exposures). The application allows users to add, retrieve, update, and delete CVE entries.
Add new CVEs
Retrieve a specific CVE by its ID
Retrieve all CVEs
Update a CVE
Delete a CVE
Python 3.9+
Flask
Flask-SQLAlchemy
pandas
Clone the Repository:
git clone https://github.com/amanmaner011/CVE_Management_API.git
cd CVE_Management_API
Create a Virtual Environment:
python -m venv venv
venv\S cripts\a ctivate
python3 -m venv venv
source venv/bin/activate
Install Dependencies:
pip install -r requirements.txt
Setup and Running the Application
Prepare the Database:
Ensure the cve_database.csv file is in the root directory.
Run the data import script to populate the database:
Run the Flask Application:
The application will start and be accessible at http://127.0.0.1:5000.
Method
URL
Description
GET
/cve/all
Retrieve all CVEs
Method
URL
Description
Example
GET
/cve/<cve_id>
Retrieve a CVE by its ID
http://127.0.0.1:5000/cve/CVE-2021-32628
Method
URL
Description
POST
/cve/addCVE
Add a new CVE
Body
{
"cve_id" : " CVE-1234-5678" ,
"severity" : " High" ,
"cvss" : 9.8 ,
"affected_packages" : " package1, package2" ,
"description" : " Sample CVE description" ,
"cwe_id" : " CWE-123"
}
Method
URL
Description
PUT
/cve/<cve_id>
Update a CVE by its ID
Body
{
"severity" : " Medium" ,
"cvss" : 5.5 ,
"affected_packages" : " package3, package4" ,
"description" : " Updated CVE description" ,
"cwe_id" : " CWE-456"
}
Method
URL
Description
Example
DELETE
/cve/<cve_id>
Delete a CVE by its ID
http://127.0.0.1:5000/cve/CVE-2021-32628
Open Postman.
Create a New Request:
For each endpoint, set up a new request in Postman with the appropriate method, URL, headers, and body.
Send Requests:
Send the requests to test the functionality of the API.
Verify Responses:
Check the responses to ensure the API is functioning correctly.